package com.zdlog.wenjuan.util;

import java.util.Random;

/**
 * @program: sell
 * @PACKAGE_NAME: com.zdlog.sell.util
 * @author: Kuaile
 * @create: 2018-01-31 16:49
 **/
public class KeyUtil {


    /**
     * 生成唯一的主键
     * 格式：时间+随机数
     *
     * @return
     */
    public static synchronized String genUniqueKey() {

        Random random = new Random();
        Integer number = random.nextInt(900000) + 100000;
        return System.currentTimeMillis() + String.valueOf(number);
    }

}
